/**
 * @Date 2020-06-24 16:22:15
 * @Remark
 */

import { Api } from "@/public/model/api";
import { ReqById, ReqPage, ResBoolean, ResObject, ResPage } from "@/public/model/base";
import { DeptDto } from "./model";

/**
 * api
 */
export const API_DEPT_PAGE: Api = {
  title: "菜单分页",
  path: "dept/list_dept",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单dept操作接口",
};

// req
export interface ReqDeptPage extends ReqPage {}

// res
export type ResDeptPage = ResPage<DeptDto>;

/**
 * api
 */
export const API_DEPT_ADD: Api = {
  title: "添加菜单",
  path: "dept/add",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单dept操作接口",
};

// req
export interface ReqDeptAdd {
  companyId: string;
  deptName: string;
  deptPId: string;
}

// res
export type ResDeptAdd = ResObject<DeptDto>;

/**
 * api
 */
export const API_DEPT_UPDATE: Api = {
  title: "编辑菜单",
  path: "dept/update",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单dept操作接口",
};

// req
export interface ReqDeptUpdate extends ReqDeptAdd {
  deptId: number;
}

// res
export type ResDeptUpdate = ResObject<DeptDto>;

/**
 * api
 */
export const API_DEPT_LIST_C_DEPT: Api = {
  title: "下级列表",
  path: "dept/list_c_dept",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单dept操作接口",
};

// req
export interface ReqDeptLISTC {
  deptPId: number;
}

// res
export interface ResDeptLISTC {
  result: number;
  message: string;
  data: [];
}

/**
 * api
 */
export const API_DEPT_DEL: Api = {
  title: "删除菜单",
  path: "dept/delete",
  method: "POST",
  prefix: "api/backstage",
  remark: "菜单dept操作接口",
};

// req
export type ReqDeptDel = ReqById;

// res
export type ResDeptDel = ResBoolean;
